IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'spDepartments_Update')
	BEGIN
		PRINT 'Dropping Procedure spDepartments_Update'
		DROP  Procedure  spDepartments_Update
	END

GO

PRINT 'Creating Procedure spDepartments_Update'
GO
Create Procedure dbo.spDepartments_Update
	( 	  
		@DivisionName varchar(50), 
		@DepartmentName varchar(50), 
		@PrimaryAuthUser_ID numeric(9,0), 
		@SecondaryAuthUser_ID numeric(9,0) = null
	)
AS
  /* 
    ------------------------------------------------------------------------------
    - Change History
    - --------------
    - Date          Description
    ------------------------------------------------------------------------------
    - 2007/11/02    Initial version Updated
    ------------------------------------------------------------------------------
  */

	-- Declare the required variables

	-- Update the required new record
	UPDATE Departments
	SET
		DivisionName = @DivisionName, 
		PrimaryAuthUser_ID = @PrimaryAuthUser_ID, 
		SecondaryAuthUser_ID = @SecondaryAuthUser_ID		
	WHERE DepartmentName = @DepartmentName

	-- Return to calling method
	RETURN
	
GO
